<template>
  <a-table
    ref="table"
    size="middle"
    bordered
    rowKey="id"
    class="table_header_blue"
    :columns="columns"
    :dataSource="dataSource"
    :pagination="ipagination"
    :loading="loading"
    @change="handleTableChange"
  >
    <span slot="actionName"> 操作 </span>
    <span slot="action" slot-scope="text, record">
      <a-popconfirm
        title="是否确认?"
        :disabled="zbStage === '06010' ? true : record.status == 1"
        @confirm="() => handleOK(record)"
      >
        <a-button :disabled="zbStage === '06010' ? true : record.status == 1" type="link">{{
          record.status == 1 ? '已确认' : '确认'
        }}</a-button>
      </a-popconfirm>
    </span>
  </a-table>
</template>
<script>
import { filePerviewMixin } from '@/mixins/filePerviewMixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction, httpAction } from '@/api/manage'
import columns from './indexColumns'

export default {
  name: 'gdxxqr',
  mixins: [JeecgListMixin, filePerviewMixin],
  props: ['id', 'stage', 'type', 'zbStage'],
  components: {},
  data() {
    return {
      queryParam: {
        proId: this.id,
      },
      columns: columns(this),
      url: {
        list: '/sjxmzygl/sjWorkGdInfo/queryGdList',
      },
    }
  },
  created() {},
  methods: {
    handleOK(record) {
      httpAction('/sjxmzygl/sjWorkGdInfo/qr', { proId: this.id, id: record.id, lx: record.lx }, 'put').then((res) => {
        if (res.success) {
          this.$message.success(res.message)
          this.loadData()
        } else {
          this.$message.error(res.message)
        }
      })
    },
  },
}
</script>

<style lang="less" scoped>
@import '~@assets/less/tableTheme.less';
.funBtn {
  padding: 0 10px;
  margin-left: 10px;
}
</style>